/**
 * @date 2006-7-11
 */

package org.nanhill.moo.web.form;

import org.nanhill.moo.domain.User;

/**
 * @author alin [xalinx at gmail dot com]
 * @date 2006-7-11
 */
public class RegisterUserForm {
	/**
	 * Email(as username).
	 */
	private String email;

	private String nickname;

	private String password;

	/**
	 * Confirm password must equals password.
	 */
	private String confirmPassword;

	/**
	 * True if Email is visible.
	 */
	private boolean emailVisible;

	/**
	 * User introduction.
	 */
	private String intro;

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String username) {
		this.email = username;
	}

	public String getConfirmPassword() {
		return confirmPassword;
	}

	public void setConfirmPassword(String confirmPassword) {
		this.confirmPassword = confirmPassword;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public boolean isEmailVisible() {
		return emailVisible;
	}

	public void setEmailVisible(boolean emailVisible) {
		this.emailVisible = emailVisible;
	}

	public String getIntro() {
		return intro;
	}

	public void setIntro(String intro) {
		this.intro = intro;
	}

	public User createUser() {
		User user = new User();
		user.setEmail(email);
		user.setNickname(nickname);
		user.setPassword(password);
		user.setEmailVisible(emailVisible);
		user.setIntro(intro);
		return user;
	}

}
